package pl.net.csrv.helpers;

import static org.junit.Assert.*;

import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;

import org.junit.Test;

public class MD5HelperTest {

	@Test
	public void testCalculateMD5() {
		String plainText = "ala ma kota";
		String hashText = null;
		try {
			 hashText = MD5Helper.calculateMD5(plainText);
		} catch (NoSuchAlgorithmException e) {
			fail(e.getMessage());
		} catch (UnsupportedEncodingException e) {
			fail(e.getMessage());
		}
		assertTrue("e2c3275d0e1a4bc0da360dd225d74a43".equals(hashText));
	}
}
